package com.hualan.controller;

import com.hualan.domain.Usermark;
import com.hualan.service.impl.UsermarkService;
import com.hualan.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/usermark")
public class UserMarkController {
    @Autowired
    private UsermarkService usermarkService;

    @GetMapping("/getUserMarkTeacher")
    public R getUserMarkTeacher(){
        return R.success(usermarkService.findUserMarkTeacher());
    }

    @PostMapping("/insertUserMark")
    public R insertUserMark(Usermark usermark){
        return R.success(usermarkService.insertUserMark(usermark));
    }

    @PostMapping("/updateUserMark")
    public R updateUserMark(Usermark usermark){
        return R.success(usermarkService.updateUserMark(usermark));
    }

    @PostMapping("/deleteUserMark")
    public R deleteUserMark(Long id){
        return R.success(usermarkService.deleteUserMark(id));
    }

    @GetMapping("/getLikeUserMark")
    public R getLikeUserMark(String message){
        return R.success(usermarkService.findLikeUserMark(message));
    }
}
